<div class="hte-layout hte-layout-fill">
	<div class="hte-panel clearfix hte-fixed" style="padding:10px;">
		<div class="example-section">
			<h3>提示信息</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-1" class="code-editor" style="width: 100%;height: 100px;">
						
	HteOS.Messager.alert("提示消息","提示消息示例");
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-1">
						<span class="glyphicon glyphicon-play" /> 运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>确认消息</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-2" class="code-editor" style="width: 100%;height: 100px;">
						
	HteOS.Messager.confirm("提示消息","提示消息示例",function(btn){
		if(btn == 'yes'){
			HteOS.Messager.alert("提示消息","您点击了确认按钮");
		}else{
			HteOS.Messager.alert("提示消息","您点击了取消按钮");
		}
	});
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-2">
						<span class="glyphicon glyphicon-play" />运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>有输入框的提示信息</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-3" class="code-editor" style="width: 100%;height: 100px;">
						
HteOS.Messager.prompt("意见建议","您觉得HteOS怎么样？",[{
			name : 'text',
			label : '在这里告诉我们您对HteOS看法'
}],function(btn,values){
	if(btn == 'yes'){
		HteOS.Messager.alert("反馈内容","您的意见：" + values.text 
		+ "<br/>非常感谢您的意见和建议");
	}else{
		HteOS.Messager.alert("提示","您点击了取消按钮");
	}
});
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-3">
						<span class="glyphicon glyphicon-play" />运行
					</button>
				</div>
			</div>
		</div>
<div class="example-section">
			<h3>有多个输入框的提示信息</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-4" class="code-editor" style="width: 100%;height: 100px;">
						
HteOS.Messager.prompt("意见反馈","我们迫切希望得到您有价值的反馈，有您的反馈，我们会做的更好！",[{
		name : 'email',
		label : '联系方式',
		inputType:"email"
	},{
		name : 'content',
		label : '反馈意见',
		multiLine : true
	}],function(btn,values){
		if(btn == 'yes'){
			if(values.content){
				HteOS.Messager.alert("意见反馈","您的意见和建议我们已收到，非常感谢");
			}
		}
	});
	</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-4">
						<span class="glyphicon glyphicon-play" />运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>自定义按钮</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-5" class="code-editor" style="width: 100%;height: 100px;">
						
HteOS.Messager.show({
	title : "自定义提示框",
	message : '通过这个示例展示如何自定义提示框',
	buttons : [{
		cls: 'btn-default',
		icon:'glyphicon glyphicon-ok-circle',
		text : '按钮1',
		key : 'btn1',
		autofocus : true
	},{
		cls: 'btn-primary',
		icon:'glyphicon glyphicon-remove-circle',
		text : '按钮2',
		key : 'btn2',
		autofocus : true
	},{
		cls: 'btn-success',
		icon:'glyphicon glyphicon-ban-circle',
		text : '按钮3',
		key : 'btn3',
		autofocus : true
	}],
	callback: function(btn,values){
		if(btn == 'btn1'){
			$(".hte-messager-tip").text("您点击了按钮1，不关闭提示框");
			return false;
		}else if(btn == 'btn2'){
			HteOS.Messager.alert("提示信息","您点击了按钮2，关闭了提示框");
		}
	}
});
	</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-5">
						<span class="glyphicon glyphicon-play" />运行
					</button>
				</div>
			</div>
		</div>
	</div>
	<script>
		//添加一次性事件
		exampleApp.once('load',function(){
			$(".example-section").each(function(){
				var textarea = $(this).find(".code-editor");
				var editor = CodeMirror.fromTextArea(textarea.get(0), {
					lineNumbers: true,
					mode: {
						name: "javascript",
						globalVars: true
					},
					lineWrapping: true
				});
				/*$("[hte-run="+ this.id +"]").click(function(){
					parent.eval(editor.getValue());
				});*/
				 $(this).find("[hte-run]").click(function(){
				 	parent.eval(editor.getValue());
				 });
			});
		});
		//添加一次性事件
		exampleApp.once('unload',function(){
		});
	</script>
</div>